﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:sys="clr-namespace:System;assembly=mscorlib" 
  xmlns:ViewModel="clr-namespace:HeritageAcademy.Models.ViewModels;assembly=HeritageAcademy.Models"
  >

  <!-- 
  *****************************************************************************
  DOCUMENT.XAML
  This ResourceDictionary contains resources apply to the elements that change
  the visual appearance of a document such as: Paragraph styles, DocumentViewer 
  styles, etc.  This is loaded by the application so it should be available 
  application wide. It's also loaded by our thumbnail generator so it's important
  to keep document related resources in here so that they stay in sync with the
  thumbnails.
  *****************************************************************************
  -->

  <!-- Default Font Stuff -->
  
  <FontFamily x:Key="DefaultFontFamily">..\Fonts\#Cambria</FontFamily>
  <sys:Double x:Key="DefaultFontSize">17</sys:Double>
  <sys:Double x:Key="DefaultLineHeight">18</sys:Double>
  <FontWeight x:Key="DefaultFontWeight">Normal</FontWeight>
  <sys:Double x:Key="DefaultTextIndent">24</sys:Double>

  <!-- Paragraph Styles -->

  <Style TargetType="Block">
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="LineHeight">
      <Setter.Value>
        <MultiBinding Converter="{StaticResource MultiplyConverter}">
          <Binding Source="{StaticResource DefaultLineHeight}" />
          <Binding Source="{x:Static ViewModel:OptionsViewModel.Current}" Path="LineSpacing.LineSpacing" />
        </MultiBinding>
      </Setter.Value>
    </Setter>
        <!--<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />-->
        <Setter Property="Margin" Value="0" />
  </Style>

  <Style TargetType="Paragraph" BasedOn="{StaticResource {x:Type Block}}">
    <Setter Property="IsHyphenationEnabled" Value="True" />
    <Setter Property="TextIndent" Value="{StaticResource DefaultTextIndent}" />
    <Setter Property="Margin" Value="0,7,0,0" />
  </Style>

  <Style x:Key="Chapter" TargetType="Section">
    <Setter Property="BreakPageBefore" Value="True" />
    <Setter Property="Padding" Value="0,100,0,0" />
  </Style>
  
  <Style x:Key="ChapterTitle" TargetType="Paragraph" BasedOn="{StaticResource {x:Type Block}}">
    <Setter Property="FontSize" Value="30px" />
    <Setter Property="Margin" Value="0,0,80,80" />
    <Setter Property="TextAlignment" Value="Left" />
    <Setter Property="LineHeight" Value="32" />
  </Style>

  <Style x:Key="ChapterNumber" TargetType="Paragraph" BasedOn="{StaticResource {x:Type Block}}">
    <Setter Property="Margin" Value="0,0,80,0" />
    <Setter Property="FontSize" Value="20" />
    <Setter Property="FontStyle" Value="Italic" />
  </Style>

</ResourceDictionary> 